home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
prolog
/
modprolg
/
mod-prol.lha
/
Prolog
/
Examples
/
slide2.mod
< prev
next >
Wrap
Text File
|
1992-06-09
|
515b
|
20 lines
signature searchsig =
sig
pred solve/2.
end.
functor dfs(p/problemsig)/searchsig =
struct
structure x = p.
solve(Node,Solution) :-
df([],Node,Solution).
df(Path,Node,[Node|Path]) :-
x:goal(Node).
df(Path,Node,Sol) :-
x:s(Node,Node1),
not member(Node1,Path),
df([Node|Path],Node1,Sol).
end.
structure eightdfs = dfs(eightqueens).